package thread.future;

import java.util.concurrent.Callable;

/**
 * 真是数据
 *
 * @author liuyj
 * @create 2017-07-11 16:21
 **/
public class RealData implements Callable<String>{

    private String para;

    public RealData(String para) {
        this.para = para;
    }

    @Override
    public String call() throws Exception {
        //这里是真实的业务逻辑，其执行可能很慢
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = 0; i < 10; i++) {
            stringBuffer.append(para);
            try {

                Thread.sleep(100);
            }catch (InterruptedException e){

            }
        }
        return stringBuffer.toString();
    }
}
